#ifndef HTTPD_H
#define HTTPD_H 1

#include "bool.h"
#include "string.h"
#include "cookie.h"

#define DEFAULT_HTTPD_TIMEOUT 3
#ifndef HTTPD_TIMEOUT
# define HTTPD_TIMEOUT DEFAULT_HTTPD_TIMEOUT
#endif

void
httpd_default_header(struct evhttp_request *req, dict_t *hdr, ck_map_t cookies);

void
httpd_out(struct evhttp_request *req, string_t *outbuf, int code, const char *reasen);

bool
httpd_run(const char *listen_addr, const uint16_t port);

void
httpd_exit(void);

#endif
